﻿<%@ Page Language="C#" MasterPageFile="~/webui/admin/adminTemplate.master" AutoEventWireup="true"
    CodeFile="admin_user.aspx.cs" Inherits="admin_user" Title=".::E-Valuation System::.." %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
   
                    <asp:PlaceHolder ID="UITabContentContainer" runat="server">


                    <div class="tabbable">  
                            <%
                                String tab1 = "";
                                String tab2 = "";
                                if (getSelectedTab().Equals("0"))
                                {
                                    tab1 = "active";
                                    tab2 = "";
                                }
                                if (getSelectedTab().Equals("1"))
                                {
                                    tab2 = "active";
                                    tab1 = "";
                                }
                            %>
                      <ul class="nav nav-tabs">
                        <li class="<%=tab1 %>">
                        <asp:LinkButton data-toggle="tab1"  ID="TabValue0" runat="server" CausesValidation="false"
                                                                    OnClick="ChangeTabIndex">
                                                                  Danh sách người dùng
                                                                </asp:LinkButton>
                        </li>
                        <li class="<%=tab2 %>">
                        <asp:LinkButton data-toggle="tab2"   ID="TabValue1" runat="server" CausesValidation="false"
                                                                    OnClick="ChangeTabIndex">
                                                                 Tạo mới người dùng
                                                                </asp:LinkButton>
                        </li>
                      </ul>
                      <div class="tab-content">
                        <div class="tab-pane  <%=tab1%>" id="tab1">
                         <asp:Panel ID="Panel0" runat="server">
                                    <div class="UserList" >
                                        <asp:DataGrid class="table-hover" ID="UserList" runat="server" DataKeyField="idguest" AllowSorting="True"
                                            ShowFooter="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#E7E7FF"
                                            BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Horizontal" Width="100%"
                                            OnDeleteCommand="UserList_DeleteCommand" OnEditCommand="UserList_EditCommand"
                                            DataSourceID="userListData" AllowPaging="true" PageSize="10">
                                            <Columns>
                                                <asp:BoundColumn DataField="hovaten" HeaderText="Họ tên"></asp:BoundColumn>
                                                <asp:BoundColumn DataField="tencongty" HeaderText="Tên công ty"></asp:BoundColumn>
                                                <asp:BoundColumn DataField="diachi" HeaderText="Địa chỉ"></asp:BoundColumn>
                                                <asp:ButtonColumn CommandName="Edit" Text="Cấp quền"></asp:ButtonColumn>
                                                <asp:ButtonColumn CommandName="Delete" Text="Xóa"></asp:ButtonColumn>
                                            </Columns>
                                        </asp:DataGrid>
                                        <asp:SqlDataSource ID="userListData" runat="server" ConnectionString="<%$ ConnectionStrings:evaConn %>"
                                            SelectCommand="select * from guest"></asp:SqlDataSource>
                                    </div>
                                    <div class="ClearAll">
                                        <span></span>
                                    </div>
                                </asp:Panel>
                        </div>
                        <div class="tab-pane <%=tab2%>"  id="tab2">
                           <asp:Panel runat="server" ID="CapPhepPanle" >
                                    <div class="form-horizontal" id="UserForm" runat="server">
                                        
                                        <div class="control-group">        
         <label class="control-label" for="mem_fullname">
                                                Tên đầy đủ</label>
                                                 <div class="controls">
                                            <asp:TextBox ID="mem_fullname" runat="server"></asp:TextBox>
                                            
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="mem_fullname"
                                                ErrorMessage="Bạn quên chưa nhập tên"></asp:RequiredFieldValidator>
                                          
                                            </div>
                                        </div>  

                                         <div class="control-group">        
         <label class="control-label" for="mem_comp">Tên công ty</label>
          <div class="controls">
                                            <asp:TextBox ID="mem_comp" runat="server" ></asp:TextBox>
                                            
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="mem_comp"
                                                ErrorMessage="Bạn quên chưa nhập tên công ty"></asp:RequiredFieldValidator>
                                    
                                            </div>
                                        </div>   

                                        <div class="control-group">        
                                            <label class="control-label" for="mem_address">
                                                Địa chỉ</label>
                                            <div class="controls">
                                                <textarea cols="5" rows="5" id="mem_address" runat="server" class="Textarea"></textarea>
                                            </div>
                                        </div>

                                        <div class="control-group">        
                                            <label class="control-label" for="mem_mail">
                                                Hòm thư</label>
                                            <div class="controls"> 
                                            <asp:TextBox ID="mem_mail" runat="server" ></asp:TextBox>&nbsp;
                                            
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="mem_mail"
                                                ErrorMessage="Bạn quên chưa nhập hòm thư"></asp:RequiredFieldValidator>
                                             
                                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="mem_mail"
                                                ErrorMessage="Hòm thư không dúng" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">
                                            </asp:RegularExpressionValidator>
                                            <asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="Hòm thư đã có, bạn đã đăng ký rồi"></asp:CustomValidator>
                                            
                                            </div>
                                        </div>

                                        <div class="control-group">        
                                            <label class="control-label" for="mem_mail">
                                                Điện thoại</label>
                                             <div class="controls">    
                                            <asp:TextBox ID="mem_phone" runat="server" ></asp:TextBox>
                                            </div>
                                        </div>

                                        <div class="control-group">       
                                            <label class="control-label" for="mem_mail"></label>
                                             <div class="controls">   
                                            <asp:Button class="btn btn-primary" ID="btn_Save" Text="Thêm mới" runat="server" OnClick="btn_Save_Click" />
                                            <asp:Button class="btn" ID="btn_Reset" Text="Làm lại" runat="server" CausesValidation="False"
                                                OnClick="btn_Reset_Click" />
                                            </div>
                                        </div>
                                    </div>
                                </asp:Panel>
                        </div>
                      </div>
                    </div>

                        
                    </asp:PlaceHolder>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
